
#include "graphics/object.h"
#include "graphics/mesh.h"
#include "graphics/camera.h"
#include "graphics/light.h"


namespace dw
{
	namespace graphics
	{

		Object::Type Object::getType() const
		{
			return UNKNOWN;
		}

		Mesh* Object::asMesh()
		{ 
			return static_cast< Mesh* >(this); 
		}

		Camera* Object::asCamera()
		{ 
			return static_cast< Camera* >(this);
		}

		Light* Object::asLight()
		{ 
			return static_cast< Light* >(this);
		}

		std::string Object::getSignature() const
		{
			return "dw::graphics::Object";
		}

		void Object::serialize(ISerializer* serializer) const
		{
			//serializer->serialize(_boundingBox);
		}

		void Object::deserialize(ISerializer* serializer)
		{
			//serializer->deserialize(_boundingBox);
		}

		std::ostream& operator<<(std::ostream& os, const Object& object)
		{
			os.write(reinterpret_cast< const char* >(&object._boundingBox), sizeof (AABBox));
			return os;
		}
			
		std::istream& operator>>(std::istream& is, Object& object)
		{
			is.read(reinterpret_cast< char* >(&object._boundingBox), sizeof (AABBox));
			return is;
		}

	} // namespace graphics
} // namespace dw